package com.jinxin.platform.cdperprotypay.controller;

import com.jinxin.platform.base.common.pojo.JsonResult;
import com.jinxin.platform.cdperprotypay.pojo.domain.ChargeStandard;
import com.jinxin.platform.cdperprotypay.pojo.form.ChargeStandardForm;
import com.jinxin.platform.cdperprotypay.service.ChargeStandardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author : zhangpeng
 * @date : 2020-06-29 09:37:08
 **/
@RestController
@RequestMapping("charge/standard")
public class ChargeStandardController {

    @Autowired
    private ChargeStandardService chargeStandardService;

    @PostMapping("/add")
    public JsonResult add(@RequestBody ChargeStandard chargeStandard){
        return chargeStandardService.insert(chargeStandard);
    }

    @PostMapping("/update")
    public JsonResult update(@RequestBody ChargeStandard chargeStandard){
        return chargeStandardService.update(chargeStandard);
    }

    @PostMapping("/del/{id}")
    public JsonResult del(@PathVariable("id") String id){
        return chargeStandardService.deleteById(id);
    }

    @PostMapping("/pageList")
    public JsonResult pageList(@RequestBody ChargeStandardForm chargeStandardForm){
        return chargeStandardService.pageList(chargeStandardForm);
    }

    @PostMapping("/queryByItems")
    public JsonResult queryByItems(ChargeStandard chargeStandard){
        return chargeStandardService.queryAll(chargeStandard);
    }

}
